import request from '@/utils/request'

// 登录方法
export function login(data) {
  return request({
    url: '/user/login',
    method: 'post',
    data: {
      userAccount: data.username,
      userPassword: data.password
    }
  })
}

// 注册方法
export function register(data) {
  return request({
    url: '/user/register',
    method: 'post',
    data: {
      userAccount: data.username,
      userPassword: data.password,
      checkPassword: data.checkPassword
    }
  })
}

// 获取用户详细信息
export function getInfo() {
  return request({
    url: '/user/get/login',
    method: 'get'
  })
}

// 退出方法
export function logout() {
  return request({
    url: '/user/logout',
    method: 'post'
  })
}